package com.wkbb.basic.thread;

import com.wkbb.basic.feign.DoorFeignService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author yangdaofang
 * 创建时间：2019-11-13 11:23
 */
@Slf4j
public class SynOrgAccessInitTask implements Runnable {
    private DoorFeignService doorFeignService;
    private Long orgId;

    public SynOrgAccessInitTask(DoorFeignService doorFeignService, Long orgId) {
        this.doorFeignService = doorFeignService;
        this.orgId = orgId;
    }

    public SynOrgAccessInitTask() {}

    @Override
    public void run() {
        try {
            log.info("进入同步默认考勤、通行权限配置.....start，orgId:{}",orgId);
            Thread.sleep(1000);
            doorFeignService.initSchoolGaleData(orgId);
            log.info("进入同步默认考勤、通行权限配置.....end");
        } catch (Exception e) {
            log.error("同步默认考勤、通行权限配置异常,{}", e);
            e.printStackTrace();
        }
    }
}
